# InterviewAgent/celery_app.py

import os
from celery import Celery
from django.conf import settings

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'InterviewAgent.settings')

app = Celery('InterviewAgent')
app.config_from_object('django.conf:settings', namespace='CELERY')
# 直接按 INSTALLED_APPS 列表去扫，不用 lambda：
app.autodiscover_tasks()

app.conf.worker_redirect_stdouts = False

@app.task(bind=True)
def debug_task(self):
    print(f'Request: {self.request!r}')
